﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using JUtil.ResourceManagement;
using System.Diagnostics;

namespace CodeGen
{
    public class SqlFile : CodeGenBase
    {
        readonly string GetOrderBy;
        readonly string GetSelectSQLNoOrderBy;
        readonly string GetSelectDetailsVwSQL;
        readonly string GetInsertSQL;
        readonly string GetUpdateSQL;
        readonly string GetDeleteSQL;

        public SqlFile(
            string GetOrderBy,
            string GetSelectSQLNoOrderBy,
            string GetSelectDetailsVwSQL,
            string GetInsertSQL,
            string GetUpdateSQL,
            string GetDeleteSQL)
        {
            this.GetOrderBy= GetOrderBy;
            this.GetSelectSQLNoOrderBy= GetSelectSQLNoOrderBy;
            this.GetSelectDetailsVwSQL= GetSelectDetailsVwSQL;
            this.GetInsertSQL= GetInsertSQL;
            this.GetUpdateSQL= GetUpdateSQL;
            this.GetDeleteSQL = GetDeleteSQL;
        }

        protected override void AssignExportTemplate(Hashtable Variables)
        {
            Variables["GetOrderBy"] = GetOrderBy;
            Variables["GetSelectSQLNoOrderBy"] = GetSelectSQLNoOrderBy;
            Variables["GetSelectDetailsVwSQL"] = GetSelectDetailsVwSQL;
            Variables["GetInsertSQL"] = GetInsertSQL;
            Variables["GetUpdateSQL"] = GetUpdateSQL;
            Variables["GetDeleteSQL"] = GetDeleteSQL;
        }

        protected override string GetExportTemplate()
        {
            return GetTemplate();
        }


    } // end of SqlFile
}
